package com.example.customviewtest.wymusic;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class MusicBean implements Parcelable {

    private List<AlbumBean> album;
    private List<HotBean> hot;

    public List<AlbumBean> getAlbum() {
        return album;
    }

    public void setAlbum(List<AlbumBean> album) {
        this.album = album;
    }

    public List<HotBean> getHot() {
        return hot;
    }

    public void setHot(List<HotBean> hot) {
        this.hot = hot;
    }

    public static class AlbumBean implements Parcelable {
        /**
         * albumId : 1
         * name : Nostalgic
         * poster : http://res.lgdsunday.club/poster-9.png
         * playNum : 203.3万
         * list : [{"musicId":"101","name":"Nostalgic Piano","poster":"http://res.lgdsunday.club/poster-1.png","path":"http://res.lgdsunday.club/Nostalgic%20Piano.mp3","author":"Rafael Krux"},{"musicId":"102","name":"La Citadelle","poster":"http://res.lgdsunday.club/poster-2.png","path":"http://res.lgdsunday.club/La%20Citadelle.mp3","author":"Komiku"},{"musicId":"103","name":"Champ de tournesol","poster":"http://res.lgdsunday.club/poster-3.png","path":"http://res.lgdsunday.club/Champ%20de%20tournesol.mp3","author":"Komiku"},{"musicId":"104","name":"Horizon Flare","poster":"http://res.lgdsunday.club/poster-4.png","path":"http://res.lgdsunday.club/Horizon%20Flare.mp3","author":"Alexander Nakarada"},{"musicId":"105","name":"Lovely Piano Song","poster":"http://res.lgdsunday.club/poster-5.png","path":"http://res.lgdsunday.club/Lovely%20Piano%20Song.mp3","author":"Rafael Krux"},{"musicId":"106","name":"Romantic Inspiration","poster":"http://res.lgdsunday.club/poster-6.png","path":"http://res.lgdsunday.club/Romantic%20Inspiration.mp3","author":"Rafael Krux"},{"musicId":"107","name":"Brothers Unite","poster":"http://res.lgdsunday.club/poster-7.png","path":"http://res.lgdsunday.club/Brothers%20Unite.mp3","author":"Alexander Nakarada"},{"musicId":"108","name":"Amazing Grace","poster":"http://res.lgdsunday.club/poster-8.png","path":"http://res.lgdsunday.club/Amazing%20Grace.mp3","author":"Kevin MacLeod"}]
         */

        private String albumId;
        private String name;
        private String poster;
        private String playNum;
        private ArrayList<ListBean> list;

        public String getAlbumId() {
            return albumId;
        }

        public void setAlbumId(String albumId) {
            this.albumId = albumId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPoster() {
            return poster;
        }

        public void setPoster(String poster) {
            this.poster = poster;
        }

        public String getPlayNum() {
            return playNum;
        }

        public void setPlayNum(String playNum) {
            this.playNum = playNum;
        }

        public ArrayList<ListBean> getList() {
            return list;
        }

        public void setList(ArrayList<ListBean> list) {
            this.list = list;
        }

        public static class ListBean implements Parcelable {
            /**
             * musicId : 101
             * name : Nostalgic Piano
             * poster : http://res.lgdsunday.club/poster-1.png
             * path : http://res.lgdsunday.club/Nostalgic%20Piano.mp3
             * author : Rafael Krux
             */

            private String musicId;
            private String name;
            private String poster;
            private String path;
            private String author;

            public String getMusicId() {
                return musicId;
            }

            public void setMusicId(String musicId) {
                this.musicId = musicId;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getPoster() {
                return poster;
            }

            public void setPoster(String poster) {
                this.poster = poster;
            }

            public String getPath() {
                return path;
            }

            public void setPath(String path) {
                this.path = path;
            }

            public String getAuthor() {
                return author;
            }

            public void setAuthor(String author) {
                this.author = author;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.musicId);
                dest.writeString(this.name);
                dest.writeString(this.poster);
                dest.writeString(this.path);
                dest.writeString(this.author);
            }

            public ListBean() {
            }

            protected ListBean(Parcel in) {
                this.musicId = in.readString();
                this.name = in.readString();
                this.poster = in.readString();
                this.path = in.readString();
                this.author = in.readString();
            }

            public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
                @Override
                public ListBean createFromParcel(Parcel source) {
                    return new ListBean(source);
                }

                @Override
                public ListBean[] newArray(int size) {
                    return new ListBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.albumId);
            dest.writeString(this.name);
            dest.writeString(this.poster);
            dest.writeString(this.playNum);
            dest.writeList(this.list);
        }

        public AlbumBean() {
        }

        protected AlbumBean(Parcel in) {
            this.albumId = in.readString();
            this.name = in.readString();
            this.poster = in.readString();
            this.playNum = in.readString();
            this.list = new ArrayList<ListBean>();
            in.readList(this.list, ListBean.class.getClassLoader());
        }

        public static final Parcelable.Creator<AlbumBean> CREATOR = new Parcelable.Creator<AlbumBean>() {
            @Override
            public AlbumBean createFromParcel(Parcel source) {
                return new AlbumBean(source);
            }

            @Override
            public AlbumBean[] newArray(int size) {
                return new AlbumBean[size];
            }
        };
    }

    public static class HotBean implements Parcelable {
        /**
         * musicId : 7
         * name : Nostalgic Piano
         * poster : http://res.lgdsunday.club/poster-1.png
         * path : http://res.lgdsunday.club/Nostalgic%20Piano.mp3
         * author : Rafael Krux
         */

        private String musicId;
        private String name;
        private String poster;
        private String path;
        private String author;

        public String getMusicId() {
            return musicId;
        }

        public void setMusicId(String musicId) {
            this.musicId = musicId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPoster() {
            return poster;
        }

        public void setPoster(String poster) {
            this.poster = poster;
        }

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public String getAuthor() {
            return author;
        }

        public void setAuthor(String author) {
            this.author = author;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.musicId);
            dest.writeString(this.name);
            dest.writeString(this.poster);
            dest.writeString(this.path);
            dest.writeString(this.author);
        }

        public HotBean() {
        }

        protected HotBean(Parcel in) {
            this.musicId = in.readString();
            this.name = in.readString();
            this.poster = in.readString();
            this.path = in.readString();
            this.author = in.readString();
        }

        public static final Creator<HotBean> CREATOR = new Creator<HotBean>() {
            @Override
            public HotBean createFromParcel(Parcel source) {
                return new HotBean(source);
            }

            @Override
            public HotBean[] newArray(int size) {
                return new HotBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(this.album);
        dest.writeList(this.hot);
    }

    public MusicBean() {
    }

    protected MusicBean(Parcel in) {
        this.album = in.createTypedArrayList(AlbumBean.CREATOR);
        this.hot = new ArrayList<HotBean>();
        in.readList(this.hot, HotBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<MusicBean> CREATOR = new Parcelable.Creator<MusicBean>() {
        @Override
        public MusicBean createFromParcel(Parcel source) {
            return new MusicBean(source);
        }

        @Override
        public MusicBean[] newArray(int size) {
            return new MusicBean[size];
        }
    };
}
